import App from './App'
import store from './store'

// #ifndef VUE3
import Vue from 'vue'
import GoEasy from './lib/goeasy-2.2.5.min.js'
Vue.prototype.$store = store
Vue.config.productionTip = false
Vue.prototype.$bus = new Vue()
// 在main.js中将goeasy初始化为全局对象，所有页面都能方便的调用，也避免多个页面反复new GoEasy对象
Vue.prototype.goEasy = GoEasy.getInstance({
	host: "hangzhou.goeasy.io",
	appkey: "BC-339ffc4b32d8450bb66ea46966c22afb",//替换为您的应用appkey
	modules: ['im'],
});
Vue.prototype.GoEasy = GoEasy;
Vue.prototype.formatDate = function (t) {
    t = t || Date.now();
    let time = new Date(t);
    let str = time.getMonth() < 9 ? ('0' + (time.getMonth() + 1)) : (time.getMonth() + 1);
    str += '-';
    str += time.getDate() < 10 ? ('0' + time.getDate()) : time.getDate();
    str += ' ';
    str += time.getHours();
    str += ':';
    str += time.getMinutes() < 10 ? ('0' + time.getMinutes()) : time.getMinutes();
    return str;
}
App.mpType = 'app'
const app = new Vue({
		store,
    ...App
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
  const app = createSSRApp(App)
  return {
    app
  }
}
// #endif